function ShowAdDiv() {
    var a = document.getElementById("divAdRight");
    var b = document.getElementById("divAdLeft");
    if (document.body.clientWidth < MainContentW + LeftBoxW + RightBoxW) {
        a.style.display = "none";
        b.style.display = "none"
    } else {
        a.style.display = "block";
        b.style.display = "block";
        FloatTopDiv()
    }
}

function FloatTopDiv() {
    function d(a) {
        var c = b.getElementById ? b.getElementById(a) : b.all ? b.all[a] : b.layers[a];
        c.sP = function (a, b) {
            this.style.left = a + "px";
            this.style.top = b + "px"
        };
        c.x = startLX;
        c.y = startLY;
        return c
    }

    function c(a) {
        var c = b.getElementById ? b.getElementById(a) : b.all ? b.all[a] : b.layers[a];
        c.sP = function (a, b) {
            this.style.left = a + "px";
            this.style.top = b + "px"
        };
        c.x = startRX;
        c.y = startRY;
        return c
    }
    var a;
    if (window.innerHeight) {
        a = window.innerHeight
    } else if (document.documentElement && document.documentElement.clientHeight) {
        a = document.documentElement.clientHeight
    } else if (document.body) {
        a = document.body.clientHeight
    }
    if (LeftPos == 2) {
        LeftPos = a - LeftBoxH - 2
    }
    if (LeftPos == 1) {
        LeftPos = (a - LeftBoxH - 2) / 2
    }
    if (RightPos == 2) {
        RightPos = a - RightBoxH - 2
    }
    if (RightPos == 1) {
        RightPos = (a - RightBoxH - 2) / 2
    }
    startLX = (document.body.clientWidth - MainContentW) / 2 - LeftBoxW - LeftAdjust, startLY = LeftPos;
    startRX = (document.body.clientWidth - MainContentW) / 2 + MainContentW + RightAdjust, startRY = RightPos;
    var b = document;
    window.stayTopLeft = function () {
        if (a < RightBoxH) {
            fSpeed = 0
        }
        if (document.documentElement && document.documentElement.scrollTop) var b = document.documentElement.scrollTop;
        else if (document.body) var b = document.body.scrollTop;
        if (document.body.scrollTop > 0) {
            startLY = LeftPos;
            startRY = RightPos
        } else {
            startLY = LeftPos;
            startRY = RightPos
        }
        ftlObj.y += (b + startRY - ftlObj.y) / fSpeed;
        ftlObj.sP(ftlObj.x, ftlObj.y);
        ftlObj2.y += (b + startLY - ftlObj2.y) / fSpeed;
        ftlObj2.sP(ftlObj2.x, ftlObj2.y);
        setTimeout("stayTopLeft()", 1)
    };
    ftlObj = c("divAdRight");
    ftlObj2 = d("divAdLeft");
    stayTopLeft()
}